import http from '../index'

const api = '/erp/config'

export function get() {
  return http.get(api)
}

export function update(data) {
  return http.post(api, data)
}

export function code(name, show = false) {
  return http.post(api + '/code', { name, show })
}

export function template() {
  return http.get(api + '/template')
}

export function templateUpdate(data) {
  return http.post(api + '/template', data)
}

export function templateSave(data) {
  return http.put(api + '/template', data)
}

export function templateDelete(data) {
  return http.delete(api + '/template/' + data.id)
}